import React,{Component} from 'react';
import './follow.css';
import {queryFollow} from "../../api/news";
import Cell from "../../components/cell";

export default class Follow extends Component {

  state = {
    follow:[],
  };

  async componentDidMount(){
    let {data:follow} = await queryFollow();
    this.setState({follow});
  }
  render(){
    let {follow} = this.state;
    return (
      <div>

        {
          follow.map((item,index)=>(
            <Cell
              key={item._id}
              title={(index + 1) + '. ' + item.title}
              label={item.des}
              to={`/detail/${item._id}?collectionName=follow`}/>
          ))
        }
      </div>
    )
  }
}